//
//  ViewController.m
//  11105
//
//  Created by student on 16/2/29.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIScrollView *scrollview;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.scrollview.contentSize = [UIImage imageNamed:@"bg"].size;
    self.scrollview.scrollEnabled = NO;
    UIImageView *img1 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bg.png"]];
    [self.scrollview addSubview:img1];
    
    // Do any additional setup after loading the view, typically from a nib.
}
- (IBAction)uppressed:(id)sender
{
    CGPoint contentoffset = self.scrollview.contentOffset;
    contentoffset.y += 10;

    [self.scrollview setContentOffset:contentoffset];
    
}
- (IBAction)downpressed:(id)sender
{
    CGPoint contentoffset = self.scrollview.contentOffset;
    contentoffset.y -= 10;
    
    [self.scrollview setContentOffset:contentoffset];
    
}
- (IBAction)right:(id)sender
{
    CGPoint contentoffset = self.scrollview.contentOffset;
    contentoffset.x -= 10;
    
    [self.scrollview setContentOffset:contentoffset];
    
}
- (IBAction)left:(id)sender
{
    CGPoint contentoffset = self.scrollview.contentOffset;
    contentoffset.x += 10;
    
    [self.scrollview setContentOffset:contentoffset];
    }
- (IBAction)upright:(id)sender
{
    CGPoint contentoffset = self.scrollview.contentOffset;
    contentoffset.y += 10;
    contentoffset.x -= 10;
    [self.scrollview setContentOffset:contentoffset];
    
}
- (IBAction)downright:(id)sender
{
    CGPoint contentoffset = self.scrollview.contentOffset;
    contentoffset.y -= 10;
    contentoffset.x -= 10;
    [self.scrollview setContentOffset:contentoffset];
    
}
- (IBAction)downleft:(id)sender
{
    CGPoint contentoffset = self.scrollview.contentOffset;
    contentoffset.y -= 10;
    contentoffset.x += 10;
    [self.scrollview setContentOffset:contentoffset];
    
}
- (IBAction)upleft:(id)sender
{
    CGPoint contentoffset = self.scrollview.contentOffset;
    contentoffset.y += 10;
    contentoffset.x += 10;
    [self.scrollview setContentOffset:contentoffset];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
